export const factoryOption = function () {
  return {
    refreshBtn: true,
    columnBtn: true,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    labelWidth: 120,
    indexLabel: '序号',
    column: [
      {
        label: '工厂名称',
        prop: 'factoryName',
        maxlength: 50,
        slot: this.slotFlg,
        rules: [
          {
            required: true,
            message: '请输入工厂名称',
            trigger: 'blur'
          }
        ]
      },
      {
        label: '公司名称',
        prop: 'companyName',
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '工厂地址',
        prop: 'factoryAddress',
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '工厂面积',
        prop: 'factoryArea',
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '生产能力',
        prop: 'productionCapacity',
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '已用生产率(%)',
        prop: 'productivity',
        precision: 2,
        type: 'number',
        maxRows: 100,
        minRows: 0,
        slot: this.slotFlg
      }
    ]
  }
}
// 产品信息
export const productOption = function () {
  return {
    refreshBtn: true,
    columnBtn: true,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    labelWidth: 160,
    indexLabel: '序号',
    column: [
      {
        label: '主要产品名称',
        prop: 'mainProducts',
        rules: [
          {
            required: true,
            message: '请输入主要产品名称',
            trigger: 'blur'
          }
        ],
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '年最大产量',
        prop: 'yearMaxCapacity',
        maxlength: 50,
        rules: [
          {
            required: true,
            message: '请输入年最大产量',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg
      },
      {
        label: '目前产能使用率(%)',
        prop: 'nowUserRatio',
        precision: 2,
        type: 'number',
        maxRows: 100,
        minRows: 0,
        rules: [
          {
            required: true,
            message: '请输入目前产能使用率(%)',
            trigger: 'blur'
          }
        ],
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '前年销售额(万元)',
        prop: 'salesPreviousYear',
        precision: 4,
        type: 'number',
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '去年销售额(万元)',
        prop: 'salesLastYear',
        precision: 4,
        type: 'number',
        maxlength: 50,
        slot: this.slotFlg
      },
      {
        label: '该产品主要客户前3',
        prop: 'mainCustomers',
        maxlength: 50,
        slot: this.slotFlg
      }
    ]
  }
}
// 客户/市场信息
export const customerOption = function () {
  return {
    refreshBtn: true,
    columnBtn: true,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    labelWidth: 140,
    indexLabel: '序号',
    column: [
      {
        label: '主要客户名称',
        prop: 'mainCustomer',
        rules: [
          {
            required: true,
            message: '请输入主要客户名称',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg
      },
      {
        label: '业务开始时间',
        prop: 'beginDate',
        type: 'date',
        rules: [
          {
            required: true,
            message: '请输入业务开始时间',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg
      },
      {
        label: '前年销售额(万元)',
        prop: 'salesPreviousYear',
        precision: 4,
        type: 'number',
        rules: [
          {
            required: true,
            message: '请输入前年销售额(万元)',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg
      },
      {
        label: '去年销售额(万元)',
        prop: 'salesLastYear',
        precision: 4,
        type: 'number',
        rules: [
          {
            required: true,
            message: '请输入去年销售额(万元)',
            trigger: 'blur'
          }
        ],
        slot: this.slotFlg
      },
      {
        label: '该客户占总比(%)',
        prop: 'ratio',
        precision: 2,
        maxRows: 100,
        minRows: 0,
        type: 'number',
        slot: this.slotFlg
      }
    ]
  }
}
// 原料信息
export const materialOption = function () {
  return {
    refreshBtn: true,
    columnBtn: true,
    border: true,
    stripe: true,
    index: true,
    editBtn: true,
    delBtn: true,
    align: 'center',
    addBtn: !['view'].includes(this.type),
    menu: !['view'].includes(this.type),
    labelWidth: 140,
    indexLabel: '序号',
    column: [
      {
        label: '主要原料名称',
        prop: 'mainMaterial',
        rules: [
          {
            required: true,
            message: '请输入主要原料名称',
            trigger: 'blur'
          }
        ],
        minWidth: 150,
        slot: this.slotFlg
      },
      {
        label: '年采购量',
        prop: 'purchaseVolume',
        rules: [
          {
            required: true,
            message: '请输入年采购量',
            trigger: 'blur'
          }
        ],
        minWidth: 100,
        slot: this.slotFlg
      },
      {
        label: '供应商',
        prop: 'materialSupplier',
        minWidth: 150,
        slot: this.slotFlg
      },
      {
        label: '合作年限',
        prop: 'cooperationYears',
        minWidth: 80,
        slot: this.slotFlg
      }
    ]
  }
}
